/**
*  组员管理
 */
<template>
  <div class="page-box h100 display-flex czbj" v-if="jhbse">
    <dxtable
      :dataJson="dataJson"
      :portUrl="portUrl"
      :qx="qx"
      :extra="extra"
      :formJson="formJson"
    ></dxtable>
  </div>
</template>
 <script lang='ts' setup>
import dxtable from "../../../components/util/dxtable.vue";
import { dxget } from "../../../util/index";
import { h, ref, reactive } from "vue";
import { leixing, leixingName } from "../../../util/config";
import { useRouter } from "vue-router";
const { currentRoute } = useRouter();
let types = 0;
const jhbse = ref(false);
let guList = ref();
if (currentRoute.value.name == "TeamManagement") {
  types = 1;
}
const extra = {
  accountType: 1,
};
// 获取组列表
let formJson = ref([]);
let dataJson = ref([]);
const getZuList = async () => {
  const { data }: any = await dxget("beRelieved/acquisitionGroup");
  guList.value = [
    {
      label: "全部",
      value: "",
    },
    ...data,
  ];
  formJson.value = [
    {
      title: "组名称",
      type: "input",
      key: "name",
      required: true, // 是否为必填
    },
    {
      title: "组类型",
      type: "select",
      key: "type",
      options: guList.value,
      val: 22,
      required: true, // 是否为必填
    },

    {
      title: "备注",
      type: "input",
      key: "remark",
      required: true, // 是否为必填
    },
  ];
  dataJson.value = [
    {
      title: "id",
      key: "id",
      width: 60,
    },
    {
      title: "组名称",
      key: "name",
      search: true, // 是否在搜索栏展示
    },
    {
      title: "组类型",
      key: "type",
      type: "select",
      options: guList.value,
      search: true, // 是否在搜索栏展示
      render(row) {
        try {
          return guList.value.filter((a) => a.value == row.type)[0].label;
        } catch (e) {
          return "";
        }
      },
    },
    {
      title: "备注",
      key: "remark",
    },
    {
      title: "添加时间",
      key: "addTime",
    },
  ];
  jhbse.value = true;
};
getZuList();

const qx = {
  DeletePermissionID: "TeamManagementindexdel", //删除
  EditPermissionIdentifier: "TeamManagementindexbj", // 编辑
  NewPermissionIdentifier: "TeamManagementindexxz", // 新建
  ViewPermissionID: "TeamManagementindexck", // 查看
};
let portUrl = "beRelieved/groupmanagement";
</script>
 <style scoped>
</style>